Skip to content

Conversation

@damacus
Copy link
Member

@damacus damacus commented Oct 16, 2025

  • Add execute resource to import GPG key into RPM database
  • Set repo_gpgcheck=false to work around metadata signature issues
  • Add KITCHEN_LOCAL_YAML to mise.toml for the Dokken driver
  • Enhance TESTING.md with local development guide
  • Create FAILING_TESTS.md to track test failures and fixes

Root cause: DNF on RHEL 9+ requires GPG keys to be imported into the RPM database, not just present as files. Additionally, repo metadata signatures can cause issues even when package signatures are valid.

This fix enables all RHEL-based platform testing which were previously blocked.

- Add execute resource to import GPG key into RPM database
- Set repo_gpgcheck=false to work around metadata signature issues
- Add KITCHEN_LOCAL_YAML to mise.toml for Dokken driver
- Enhance TESTING.md with comprehensive local development guide
- Create FAILING_TESTS.md to track test failures and fixes

Root cause: DNF on RHEL 9+ requires GPG keys to be imported into the
RPM database, not just present as files. Additionally, repo metadata
signatures can cause issues even when package signatures are valid.

This fix enables all RHEL-based platform testing which were previously blocked.

Signed-off-by: Dan Webb <[email protected]>
@damacus damacus requested a review from a team as a code owner October 16, 2025 13:08
PostgreSQL uses different GPG keys for signing aarch64 vs x86_64 packages.
The previous fix attempted to import the generic key, but packages were
still failing verification because they were signed with arch-specific keys.

Changes:
- Update default_yum_gpg_key_uri helper to detect architecture
- Use PGDG-RPM-GPG-KEY-AARCH64-RHEL for aarch64 on RHEL 8+
- Use PGDG-RPM-GPG-KEY-AARCH64-RHEL7 for aarch64 on RHEL 7
- Keep generic keys for x86_64 architecture
- Remove not_if guard from rpm import (command is idempotent)

Verified on:
- centos-stream-9 (aarch64): PASSING
- rockylinux-9 (aarch64): PASSING
- debian-12 (aarch64): PASSING

This fully resolves the GPG verification failures on RHEL-based platforms.
Use >= 7.2 instead of >= 7.2.0 per Chef metadata best practices.
Version constraints should use major.minor format without patch version.
@damacus damacus force-pushed the fix-up branch 4 times, most recently from 4acbe37 to faa200e Compare October 20, 2025 22:04
@github-actions
Copy link

Slowest examples

Top 10 slowest examples (0.01 seconds, 48.72% of total time)
Example Description Time in seconds
spec/libraries/helpers_spec.rb:19 PostgreSQL::Cookbook::Helpers#data_dir(version) with rhel family and Postgres 11 from repo returns the correct path 0.01305
spec/libraries/helpers_spec.rb:27 PostgreSQL::Cookbook::Helpers#data_dir(version) with rhel family and Postgres 11 from os returns the correct path 0.00044
spec/libraries/helpers_spec.rb:43 PostgreSQL::Cookbook::Helpers#data_dir(version) with debian family and Postgres 12 from os returns the correct path 0.00043
spec/libraries/helpers_spec.rb:95 PostgreSQL::Cookbook::Helpers#default_platform_service_name(version) with rhel family and Postgres 12 from repo returns the correct service name 0.00041
spec/libraries/helpers_spec.rb:119 PostgreSQL::Cookbook::Helpers#default_platform_service_name(version) with debian family and Postgres 12 from os returns the correct service name 0.00041
spec/libraries/helpers_spec.rb:73 PostgreSQL::Cookbook::Helpers#conf_dir(version) with debian family and Postgres 14 from repo returns the correct path 0.0004
spec/libraries/helpers_spec.rb:27 PostgreSQL::Cookbook::Helpers#data_dir(version) with rhel family and Postgres 12 from os returns the correct path 0.0004
spec/libraries/helpers_spec.rb:111 PostgreSQL::Cookbook::Helpers#default_platform_service_name(version) with debian family and Postgres 15 from repo returns the correct service name 0.0004
spec/libraries/helpers_spec.rb:43 PostgreSQL::Cookbook::Helpers#data_dir(version) with debian family and Postgres 14 from os returns the correct path 0.00039
spec/libraries/helpers_spec.rb:95 PostgreSQL::Cookbook::Helpers#default_platform_service_name(version) with rhel family and Postgres 13 from repo returns the correct service name 0.00039

@github-actions
Copy link

Slowest examples

Top 10 slowest examples (0.01 seconds, 48.28% of total time)
Example Description Time in seconds
spec/libraries/helpers_spec.rb:19 PostgreSQL::Cookbook::Helpers#data_dir(version) with rhel family and Postgres 11 from repo returns the correct path 0.01261
spec/libraries/helpers_spec.rb:35 PostgreSQL::Cookbook::Helpers#data_dir(version) with debian family and Postgres 13 from repo returns the correct path 0.0004
spec/libraries/helpers_spec.rb:27 PostgreSQL::Cookbook::Helpers#data_dir(version) with rhel family and Postgres 11 from os returns the correct path 0.0004
spec/libraries/helpers_spec.rb:119 PostgreSQL::Cookbook::Helpers#default_platform_service_name(version) with debian family and Postgres 11 from os returns the correct service name 0.00039
spec/libraries/helpers_spec.rb:103 PostgreSQL::Cookbook::Helpers#default_platform_service_name(version) with rhel family and Postgres 11 from os returns the correct service name 0.00038
spec/libraries/helpers_spec.rb:119 PostgreSQL::Cookbook::Helpers#default_platform_service_name(version) with debian family and Postgres 12 from os returns the correct service name 0.00038
spec/libraries/helpers_spec.rb:119 PostgreSQL::Cookbook::Helpers#default_platform_service_name(version) with debian family and Postgres 15 from os returns the correct service name 0.00038
spec/libraries/helpers_spec.rb:35 PostgreSQL::Cookbook::Helpers#data_dir(version) with debian family and Postgres 11 from repo returns the correct path 0.00038
spec/libraries/helpers_spec.rb:95 PostgreSQL::Cookbook::Helpers#default_platform_service_name(version) with rhel family and Postgres 13 from repo returns the correct service name 0.00038
spec/libraries/helpers_spec.rb:111 PostgreSQL::Cookbook::Helpers#default_platform_service_name(version) with debian family and Postgres 11 from repo returns the correct service name 0.00037

@bmhughes bmhughes added Bug Something isn't working Release: Minor Release to Chef Supermarket as a minor release when merged labels Oct 21, 2025
@bmhughes bmhughes merged commit f4de4b5 into main Oct 21, 2025
142 of 164 checks passed
@bmhughes bmhughes deleted the fix-up branch October 21, 2025 10:01
Copilot AI pushed a commit that referenced this pull request Oct 21, 2025
…#810)

* fix(install): resolve GPG key verification failures on RHEL platforms

- Add execute resource to import GPG key into RPM database
- Set repo_gpgcheck=false to work around metadata signature issues
- Add KITCHEN_LOCAL_YAML to mise.toml for Dokken driver
- Enhance TESTING.md with comprehensive local development guide
- Create FAILING_TESTS.md to track test failures and fixes

Root cause: DNF on RHEL 9+ requires GPG keys to be imported into the
RPM database, not just present as files. Additionally, repo metadata
signatures can cause issues even when package signatures are valid.

This fix enables all RHEL-based platform testing which were previously blocked.

Signed-off-by: Dan Webb <[email protected]>

* fix(install): use architecture-specific GPG keys for RHEL platforms

PostgreSQL uses different GPG keys for signing aarch64 vs x86_64 packages.
The previous fix attempted to import the generic key, but packages were
still failing verification because they were signed with arch-specific keys.

Changes:
- Update default_yum_gpg_key_uri helper to detect architecture
- Use PGDG-RPM-GPG-KEY-AARCH64-RHEL for aarch64 on RHEL 8+
- Use PGDG-RPM-GPG-KEY-AARCH64-RHEL7 for aarch64 on RHEL 7
- Keep generic keys for x86_64 architecture
- Remove not_if guard from rpm import (command is idempotent)

Verified on:
- centos-stream-9 (aarch64): PASSING
- rockylinux-9 (aarch64): PASSING
- debian-12 (aarch64): PASSING

This fully resolves the GPG verification failures on RHEL-based platforms.

* chore: fix yum dependency version constraint

Use >= 7.2 instead of >= 7.2.0 per Chef metadata best practices.
Version constraints should use major.minor format without patch version.

* chore: add gpg cookbook dependency

Signed-off-by: Dan Webb <[email protected]>

* Remove CentOS 8 based platforms from testing

Signed-off-by: Dan Webb <[email protected]>

---------

Signed-off-by: Dan Webb <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Release: Minor Release to Chef Supermarket as a minor release when merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants